package test.study.kits.excel.poi;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;

@Slf4j
public class PoiMain {

    @SneakyThrows
    @Test
    public void test() {

        XSSFWorkbook workbook = new XSSFWorkbook("d:\\testfff.xls");
        XSSFSheet sheet = workbook.getSheetAt(0);

        for (Row row : sheet) {

            for (Cell cell : row) {
                String value = cell.getStringCellValue();
                log.info("{}", value);
            }
        }
    }
}
